package Stack练习;

import java.util.Deque;
import java.util.LinkedList;

public class use_stack2 {
    public static void main(String[] args) {
        Deque<String> stack=new LinkedList<>();
        //用Deque类型的引用stack指向了一个具体的LinkedList对象
        System.out.println(stack);

        stack.push("A");
        stack.push("B");
        stack.push("C");
        stack.push("D");
        System.out.println(stack);

        System.out.println(stack.peek());
        System.out.println(stack);
        System.out.println(stack.pop());
        System.out.println(stack);
        System.out.println(stack.isEmpty());
    }
}
